package hy.config;

import com.netflix.loadbalancer.IRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//@Configuration
public class ConfigBean {
    @Bean//HttpClient
    @LoadBalanced
    public RestTemplate getTmp(){
        return new RestTemplate();
    }

    @Bean
    public IRule rule(){
//        return new RoundRobinRule();
//        return new RandomRule();
//        return new RetryRule();
//        return new BestAvailableRule();
//        return new WeightedResponseTimeRule();
        //使用nacos配置面板中配置的权重实现
//        return new NacosRule();
        return new ReThreeRule();
    }
}